<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>沂水旅游</title>
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="/static/index/css/index.css">
    <link rel="stylesheet" href="/static/layuiadmin/layui/css/layui.css">
</head>
<body>

<div class="banner" style="position: relative;">
    <div class="nav layui-hide-xs">
        <div class="layui-container">
            <div class="layui-row">
                <div class="layui-col-md3">

                    <div class="logo">
                        <img src="/static/index/images/logo.png" alt="logo">
                    </div>

                </div>
                <div class="layui-col-md6 layui-col-md-offset1">

                    <div class="layui-row">
                        <div class="layui-col-md2 layui-col-xs12">
                            <a class="nav-item" href="{:url('tour/tourList')}">景点</a>
                        </div>
                        <div class="layui-col-md2 layui-col-xs12">
                            <a class="nav-item" href="{:url('hotel/hotelList')}">酒店</a>
                        </div>
                        <div class="layui-col-md2 layui-col-xs12">
                            <a class="nav-item" href="{:url('food/foodList')}">美食</a>
                        </div>
                        <div class="layui-col-md2 layui-col-xs12">
                            <a class="nav-item" href="{:url('group/groupList')}">跟团</a>
                        </div>
                        <div class="layui-col-md2 layui-col-xs12">
                            <a class="nav-item" href="{:url('circle/circleList')}">友圈</a>
                        </div>
                    </div>

                </div>
                <div class="layui-col-md2">
                    <div class="loginButtonBox">
                        {empty name="Think.session.uid"}
                        <a class="loginButton" href="{:url('login/login')}">登录/注册</a>
                        {else/}
                        <div class="al-log-show">
                            <a class="alreadyButton">{$Think.session.nickname}</a>
                            <div class="login-show-box">
                                <div class="login-show-box-cen">
                                    <a href="{:url('my/other')}">个人中心</a>
                                    <a href="javascript:;">修改密码</a>
                                    <a style="margin-bottom: 0;" href="javascript:;" id="logout">退出登录</a>
                                </div>
                            </div>
                        </div>
                        {/empty}
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!--轮播图-->
    <div class="layui-carousel" id="topBanner">
        <div carousel-item class="carousel-item">
            {volist name="banner" id="vol"}

            <div>
                <a href="{$vol.banner_link}">
                    <img src="{$vol.banner_img}" alt="">
                </a>
            </div>

            {/volist}
        </div>
    </div>

    <!--搜索-->
    <div class="searchBox layui-hide-xs">
        <form class="layui-form" action="">
            <div class="searchBox_radio">
                <input type="radio" name="kinds" value="1" checked title="景点">
                <input type="radio" name="kinds" value="2" title="酒店">
                <input type="radio" name="kinds" value="3" title="美食">
                <input type="radio" name="kinds" value="4" title="跟团">
                <input type="radio" name="kinds" value="5" title="游圈">
            </div>
            <div class="searchBox_input">
                <div class="input_l">
                    <input type="text" id="searchContent" name="searchContent" placeholder="搜索景点/酒店/美食/攻略等">
                </div>
                <div class="input_r">
                    <button class="searchButton"  lay-submit lay-filter="searchIng" href="javascript:;" id="searchIng"><i class="layui-icon layui-icon-search"></i></button>
                </div>
            </div>
        </form>
    </div>
</div>

<!--精选行程-->
<div class="layui-container  xingcheng">

    <div class="index-header layui-hide-xs">
        <img src="/static/index/images/index-xingcheng-title.png" alt="">
    </div>
    <div class="index-header layui-hide-md" style="width: 60%;margin:0 auto 1rem;">
        <img src="/static/index/images/index-xingcheng-title.png" alt="">
    </div>

    <div class="selectYouWant">
        <button class="selectYouWantButton selectYouWantButton-active" id="showTour">玩啥</button>
        <button class="selectYouWantButton" id="showRestaurant">吃啥</button>
        <button class="selectYouWantButton" id="showHotel">住啥</button>
    </div>

    <div class="layui-row layui-col-space10 index-header-main layui-hide-xs">

        <div class="layui-col-md5" id="selected-journey-left">

            <a href="javascript:;" id="selected-journey-first-a-0">
                <img id="selected-journey-first-img" src="http://qiniu.lancly.com//index/user/dafaultUserIcon.png?1" alt="">
            </a>

        </div>

        <div class="layui-col-md7" id="selected-journey-right">

            <div class="layui-row layui-col-space10" id="selected-journey-left-1">

                <div class="layui-col-md5">
                    <a href="javascript:;" id="selected-journey-first-a-1">
                        <img src="http://qiniu.lancly.com//index/user/dafaultUserIcon.png?1" id="selected-journey-first-img-1" alt="">
                    </a>
                </div>
                <div class="layui-col-md7">
                    <a href="javascript:;" id="selected-journey-first-a-2">
                        <img src="http://qiniu.lancly.com//index/user/dafaultUserIcon.png?1" id="selected-journey-first-img-2" alt="">
                    </a>
                </div>
                <div class="layui-col-md7" style="padding-bottom: 0;">
                    <a href="javascript:;" id="selected-journey-first-a-3">
                        <img src="http://qiniu.lancly.com//index/user/dafaultUserIcon.png?1" id="selected-journey-first-img-3" alt="">
                    </a>
                </div>
                <div class="layui-col-md5" style="padding-bottom: 0;">
                    <a href="javascript:;" id="selected-journey-first-a-4">
                        <img src="http://qiniu.lancly.com//index/user/dafaultUserIcon.png?1" id="selected-journey-first-img-4" alt="">
                    </a>
                </div>

            </div>
        </div>


    </div>

    <div class="layui-row layui-col-space10 index-header-main layui-hide-md" id="mobile_xingcheng">

        {volist name="tour" id="vol"}
        <div class="layui-col-xs12">
            <a href="/index/tour/tour/id/{$vol.tour_id}">
                <img src="{$vol.tour_covers}" alt="">
            </a>
        </div>
        {/volist}

    </div>

    <div class="layui-row">
        <div class="getMore">
            <a id="showMore" href="{:url('tour/tourList')}">查看更多</a>
        </div>
    </div>

</div>

<!--友圈开始-->
<div class="gonglv">

    <div class="layui-container">
        <div class="index-header layui-hide-xs">
            <img src="/static/index/images/index-youquan-title.png" alt="">
        </div>
        <div class="index-header layui-hide-md" style="width: 60%;margin:0 auto 1rem;">
            <img src="/static/index/images/index-youquan-title.png" alt="">
        </div>

        <div class="selectYouWant">
            <button class="selectYouquanButton selectYouquanButton-active" id="showGonglve">旅游攻略</button>
            {foreach $frinds_circle_tag as $key => $value}
                <button class="selectYouquanButton" onclick="getCircle(this,{$value.id})">{$value.data_name}</button>
            {/foreach}
        </div>

        <div class="layui-row layui-col-space12" id="yuoquan_content">

            {foreach $method as $key => $value}
            <div class="layui-col-md4 ">

                <div class="youquan-ever-box">

                    <div class="layui-row">

                        <div class="layui-col-md5 layui-col-xs5">
                            <div class="gonglve_img">
                                <a href="{:url('method/method',['id'=>$value.id])}">
                                    <img src="{$value.image}" alt="">
                                </a>
                            </div>
                        </div>
                        <div class="layui-col-md7 layui-col-xs7">
                            <div class="gonglve_info">
                                <div class="gentuanyou_info_title">
                                    <a href="{:url('method/method',['id'=>$value.id])}">{$value.title}</a>
                                </div>
                                <div class="gonglv-user">
                                    {$value.nickname}
                                </div>

                                <div class="gentuanyou_info_num">
                                    {$value.create_time}
                                </div>
                            </div>
                        </div>
                    </div>

                </div>

            </div>
            {/foreach}

        </div>

        <div class="layui-row">
            <div class="getMore">
                <a href="{:url('method/methodList')}" id="showMoreCircle">查看更多</a>
            </div>
        </div>

    </div>
</div>

<div class="layui-container gentuanyou">

    <div class="index-header layui-hide-xs">
        <img src="/static/index/images/index-gentuan-title.png" alt="">
    </div>
    <div class="index-header layui-hide-md" style="width: 60%;margin:0 auto 1rem;">
        <img src="/static/index/images/index-gentuan-title.png" alt="">
    </div>

    <div class="layui-row layui-col-space12">

        {foreach $groupTour as $k => $v}
        <div class="layui-col-md4 ">
            <div class="layui-row">
                <div class="layui-col-md5 layui-col-xs5">
                    <div class="gentuanyou_img">
                        <img src="{$v.gtour_covers}" alt="">
                        <span class="more-you">
                            {eq name="$v.gtour_days" value="1"}
                                一日游
                            {else/}
                                多日游
                            {/eq}

                        </span>
                    </div>
                </div>
                <div class="layui-col-md7 layui-col-xs7">
                    <div class="gentuanyou_info">
                        <div class="gentuanyou_info_title">
                            <a href="{:url('group/group',['id'=>$v.id])}">{$v.gtour_title}</a>
                        </div>
                        <div class="gentuanyou_info_price">
                            <b>￥</b><span>{$v.gtour_price}</span>
                        </div>

                        <div class="gentuanyou_info_num">
                            已售<span>{$v.sale_sum}</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        {/foreach}

    </div>

    <div class="layui-row">
        <div class="getMore">
            <a href="javascript:;">查看更多</a>
        </div>
    </div>
</div>


<div class="height100 layui-hide-xs"></div>

<script src="/static/layuiadmin/layui/layui.all.js"></script>
<script src="/static/js/jquery-3.2.1.min.js"></script>
{include file="public/footer" /}
<script>
        var $ = layui.jquery;
        var   layer = layui.layer
            , element = layui.element
            , carousel = layui.carousel
            , form = layui.form;

        getXingcheng("{:url('index/getTuijianTour')}", "/index/tour/tour/id/");
        //搜索提交
        form.on('submit(searchIng)', function(data){

            var title = data.field.searchContent;
            var kinds = data.field.kinds;

            if (title == ''){
                return false;
            }

            if (kinds == 1){
                window.location.href = "{:url('tour/tourList')}?title=" + title;
            } else if(kinds == 2){
                window.location.href = "{:url('hotel/hotelList')}?title=" + title;
            } else if(kinds == 3){
                window.location.href = "{:url('food/foodList')}?title=" + title;
            } else if(kinds == 4){
                window.location.href = "{:url('group/groupList')}?title=" + title;
            } else if(kinds == 5){
                window.location.href = "{:url('circle/circleList')}?title=" + title;
            }

            return false;
        });

        //建造实例
        carousel.render({
            elem: '#topBanner'
            , width: '100%' //设置容器宽度
            , arrow: 'none' //始终显示箭头
            , anim: 'fade' //切换动画方式
        });

        $('.alreadyButton').mouseenter(function(){

            $('.login-show-box').show();
        });

        $('.alreadyButton').mouseleave(function(){
            
            $('.login-show-box').hide();
        });

        $('.login-show-box-cen').mouseenter(function(){
            
            $('.login-show-box').show();
        });

        $('.login-show-box-cen').mouseleave(function(){
            
            $('.login-show-box').hide();
        });

        $('#logout').click(function(){

            layer.alert('确认退出登录吗？',function(){
                $.ajax({
                    type: "post",
                    url: "{:url('loginout')}",
                    dataType: 'json',
                    data: {},
                    success: function (data) {
                        if (data.code) {

                                layer.closeAll();

                                layer.msg('退出成功',{anim: 0,time:1000},function(){
                                    window.location.reload();
                                });

                        }
                    }
                });
            });
        })


        var bannerH = $('.carousel-item img')[0].height;
        $('.layui-carousel').css('height', bannerH + 'px');

        //展示精选景点
        $('#showTour').click(function () {

            $('#showTour').addClass('selectYouWantButton-active');
            $('#showRestaurant').removeClass('selectYouWantButton-active');
            $('#showHotel').removeClass('selectYouWantButton-active');

            $('#showMore').attr('href', "{:url('tour/tourList')}");

            getXingcheng("{:url('index/getTuijianTour')}", "/index/tour/tour/id/");

        });

        //展示精选美食
        $('#showRestaurant').click(function () {

            $('#showTour').removeClass('selectYouWantButton-active');
            $('#showRestaurant').addClass('selectYouWantButton-active');
            $('#showHotel').removeClass('selectYouWantButton-active');

            $('#showMore').attr('href', "{:url('restaurant/restaurantList')}");

            getXingcheng("{:url('index/getTuijianRestaurant')}", "/index/restaurant/restaurant/id/");

        });

        //展示精选酒店
        $('#showHotel').click(function () {

            $('#showTour').removeClass('selectYouWantButton-active');
            $('#showRestaurant').removeClass('selectYouWantButton-active');
            $('#showHotel').addClass('selectYouWantButton-active');

            $('#showMore').attr('href', "{:url('hotel/hotelList')}");

            getXingcheng("{:url('index/getTuijianHotel')}", "/index/hotel/hotel/id/");

        });

        //获取攻略
        $('#showGonglve').click(function(){

            $('#showMoreCircle').attr('href',"{:url('method/methodList')}");

            $('.selectYouquanButton').removeClass('selectYouquanButton-active');

            $(this).addClass('selectYouquanButton-active');

            var loading = layer.load(1, {
                shade: [0.1, '#fff'] //0.1透明度的白色背景
            });

            $.ajax({
                type: "post",
                url: "{:url('getMethod')}",
                dataType: 'json',
                data: {},
                success: function (data) {

                    layer.closeAll();

                    if (data) {

                        $('#yuoquan_content').html("");

                        $.each(data, function (i, item) {

                            var str = "";
                            str += '<div class="layui-col-md4 ">';

                            str += '<div class="youquan-ever-box">';

                            str += '<div class="layui-row">';

                            str += '<div class="layui-col-md5 layui-col-xs5">';
                            str += '<div class="gonglve_img">';
                            str += '<a href="index/method/method/id/'+ item.id +'.html">';
                            str += '<img src="' + item.image +'" alt="">';
                            str += '</a>';
                            str += '</div>';
                            str += '</div>';
                            str += '<div class="layui-col-md7 layui-col-xs7">';
                            str += '<div class="gonglve_info">';
                            str += '<div class="gentuanyou_info_title">';
                            str += '<a href="index/method/method/id/'+ item.id +'.html">'+ item.title +'</a>';
                            str += '</div>';
                            str += '<div class="gonglv-user">';
                            str += item.nickname;
                            str += '</div>';

                            str += '<div class="gentuanyou_info_num">';
                            str += item.create_time;
                            str += '</div>';
                            str += '</div>';
                            str += '</div>';
                            str += '</div>';

                            str += '</div>';

                            str += '</div>';

                            $('#yuoquan_content').append(str);

                        });

                    }

                }
            });


        });

        //获取友圈
        window.getCircle = function(obj,id){

            $('#showMoreCircle').attr('href',"{:url('circle/circleList')}");

            $('.selectYouquanButton').removeClass('selectYouquanButton-active');
            $(obj).addClass('selectYouquanButton-active');

            var loading = layer.load(1, {
                shade: [0.1, '#fff'] //0.1透明度的白色背景
            });

            $.ajax({
                type: "post",
                url: "{:url('getFriendCircle')}",
                dataType: 'json',
                data: {fc_id:id},
                success: function (data) {

                    layer.closeAll();

                    if (data) {

                        $('#yuoquan_content').html("");

                        $.each(data, function (i, item) {

                            var str = "";
                            str += '<div class="layui-col-md4 ">';

                            str += '<div class="youquan-ever-box">';

                            str += '<div class="layui-row">';

                            str += '<div class="layui-col-md5 layui-col-xs5">';
                            str += '<div class="gonglve_img">';
                            str += '<a href="index/method/method/id/'+ item.id +'.html">';
                            str += '<img src="' + item.image +'" alt="">';

                            if (item.kinds == 2){
                                str += '<i></i>';
                            }

                            str += '</a>';
                            str += '</div>';
                            str += '</div>';
                            str += '<div class="layui-col-md7 layui-col-xs7">';
                            str += '<div class="gonglve_info">';
                            str += '<div class="gentuanyou_info_title">';
                            str += '<a href="index/method/method/id/'+ item.id +'.html">'+ item.title +'</a>';
                            str += '</div>';
                            str += '<div class="gonglv-user">';
                            str += item.nickname;
                            str += '</div>';

                            str += '<div class="gentuanyou_info_num">';
                            str += item.create_time;
                            str += '</div>';
                            str += '</div>';
                            str += '</div>';
                            str += '</div>';

                            str += '</div>';

                            str += '</div>';

                            $('#yuoquan_content').append(str);

                        });

                    }

                }
            });

        }


        function getXingcheng(getUrl, toUrl) {

            var loading = layer.load(1, {
                shade: [0.1, '#fff'] //0.1透明度的白色背景
            });

            $.ajax({
                type: "post",
                url: getUrl,
                dataType: 'json',
                data: {},
                success: function (data) {

                    layer.closeAll();

                    $('#selected-journey-first-a-0').attr('href','javascript:;');
                    $('#selected-journey-first-img').attr('src','http://qiniu.lancly.com//index/user/dafaultUserIcon.png?1');

                    $('#selected-journey-first-a-1').attr('href','javascript:;');
                    $('#selected-journey-first-img-1').attr('src','http://qiniu.lancly.com//index/user/dafaultUserIcon.png?1');


                    $('#selected-journey-first-a-2').attr('href','javascript:;');
                    $('#selected-journey-first-img-2').attr('src','http://qiniu.lancly.com//index/user/dafaultUserIcon.png?1');


                    $('#selected-journey-first-a-3').attr('href','javascript:;');
                    $('#selected-journey-first-img-3').attr('src','http://qiniu.lancly.com//index/user/dafaultUserIcon.png?1');


                    $('#selected-journey-first-a-4').attr('href','javascript:;');
                    $('#selected-journey-first-img-4').attr('src','http://qiniu.lancly.com//index/user/dafaultUserIcon.png?1');

                    if (data.hasOwnProperty("0")){
                        $('#selected-journey-first-a-0').attr('href', toUrl + data[0]['id'] + '.html');
                        $('#selected-journey-first-img').attr('src', data[0]['path']);
                    }

                    if (data.hasOwnProperty("1")){
                        $('#selected-journey-first-a-1').attr('href', toUrl + data[1]['id'] + '.html');
                        $('#selected-journey-first-img-1').attr('src', data[1]['path']);
                    }

                    if (data.hasOwnProperty("2")){
                        $('#selected-journey-first-a-2').attr('href', toUrl + data[2]['id'] + '.html');
                        $('#selected-journey-first-img-2').attr('src', data[2]['path']);
                    }

                    if (data.hasOwnProperty("3")){
                        $('#selected-journey-first-a-3').attr('href', toUrl + data[3]['id'] + '.html');
                        $('#selected-journey-first-img-3').attr('src', data[3]['path']);
                    }

                    if (data.hasOwnProperty("4")){
                        $('#selected-journey-first-a-4').attr('href', toUrl + data[4]['id'] + '.html');
                        $('#selected-journey-first-img-4').attr('src', data[4]['path']);

                    }

                    $('#mobile_xingcheng').html("");

                    $.each(data, function (i, item) {

                        var str = "";
                        str += '<div class="layui-col-xs12">';
                        str += '<a href="' + toUrl + item.id + '">';
                        str += '<img src="' + item.path + '" alt="">';
                        str += '</a>';
                        str += '</div>';

                        $('#mobile_xingcheng').append(str);

                    });


                }
            });

        }

</script>
</body>
</html>